<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<link href="themes/css/ui.common.css" rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.child.css" rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.tips.css" rel="stylesheet" type="text/css" />
		<link href="style/jquery_ui/jquery-ui-1.8.custom.css" rel="stylesheet"
			type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="themes/css/ui.c.blue.css"></link>
		<link rel="stylesheet" href="themes/default/pagination.css"
			type="text/css"></link>
		<link rel="stylesheet" href="themes/css/ui.validation.css" type="text/css"></link>
		<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
		<script src="Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>
		<script src="Scripts/ui.tips.js" type="text/javascript"></script>
		<script src="Scripts/ui.default.js " type="text/javascript"
			charset="UTF-8"></script>
		<script src="Scripts/ui.admincp.js" type="text/javascript"
			charset="UTF-8"></script>
		<script type="text/javascript" src="Scripts/jquery.json-2.2.min.js"></script>
		<STYLE type="text/css">
		.editorArea {
			display: none;
		}
		</STYLE>
		<script type="text/javascript" src="Scripts/ui.dialogFormHelper.js"></script>
		<script type="text/javascript" src="Scripts/ui.validation.js"></script>
		<script type="text/javascript">
		$(function () {
			setValidate();
		    switcher();
		});
		
		function setValidate(){  
	   		$("#form").validatingForm({
	      	  submitButtonId:"#btnSubmit",
	     	   clearErrorsOnFocus:true,
	      	  validateOnBlur:true
	       });
	    }
		
		function switcher() {
		    $("#sectionSelector").change(function () {
		        var sectionId = $(this).val();
		        $.post("staffInfo!queryPostBySection.action", { "sectionId": sectionId }, function (data) {
		            if (data != '')
		            //对应的物资信息添加到select中
		                $("#postSelector").html("").append(data);
		            else
		                $("#postSelector").html("").append("<option value=\"-1\">-请先选择部门-</option>");
		        }, "html");
		    });
		}
		
		</script>
	</head>
	<body>
		<div class="PageChild_Title">
			<img src=" themes/images/default/icons/archives.png"
				class="PageChild_Tbtnpic" />
			<span class="PageChild_separate"></span>
			<span class="PageChild_TbtnText">
				<h2>修改员工信息</h2>
			</span>
			<span class="PageChild_separate"></span>
			<div id="marker" class="red-tips">
			</div>
			<div class="clear">
			</div>
		</div>
		<form action="staffInfo!modifyStaff.action" method="post">
		<table  id="form" style="border: 1px solid gray; padding: 1px;" border="0"
			cellpadding="0" cellspacing="0" align="center">
			<tr>
				<td colspan="4" align="center">
					<s:if test="str != null"><FONT color="red">${str}</FONT></s:if>
				</td>
			</tr>
			<tr>
				<td colspan="4" align="center">
					<input id="txt_staffId" name="staffId" value="${staffInfo.staffId}" type="hidden">
				</td>
			</tr>
			<tr>
				<td class="text-align-right" style="width: 80px;">
					&nbsp;员工号:
				</td>
				<td style="width: 100px" valign="middle" class="style1">
					<input id="txt_staffNo" name="staffNo" class="control-width-100 required-field no-Chinese-field input-control clearable" value="${staffInfo.staffNo}" disabled="disabled">
				</td>
				<td class="text-align-right" style="width: 80px;">
					&nbsp;密码:
				</td>
				<td style="width: 220px" valign="middle" class="style1">
					<input name="staffPwd" class="control-width-100 input-control clearable" value="******" disabled="disabled">
				</td>
			</tr>
			<tr>
				<td class="text-align-right" style="width: 80px;">
					&nbsp; 姓名:
				</td>
				<td style="width: 100px" valign="middle" class="style1">
					<input id="staffName" name="staffName" class="control-width-100 required-field  input-control clearable" value="${staffInfo.staffName}">
				</td>
				<td class="text-align-right" style="width: 80px;">
				</td>
				<td style="width: 220px" class="style1">
				</td>
			</tr>
			<tr>
				<td class="text-align-right">
					&nbsp;所在部门:
				</td>
				<td class="style1">
					<s:select list="sectionList" listKey="sectionId" listValue="sectionName" id="sectionSelector" name="sectionId" headerKey="" headerValue="-请选择-" theme="simple" cssClass="control-width-40 clearable" cssStyle="width: 152px; height: 26px"></s:select>
				</td>
				<td class="text-align-right">
					&nbsp;所在职位:
				</td>
				<td class="style1">
                	<s:select list="postList" listKey="postId" listValue="postName" name="postId" id="postSelector" theme="simple" emptyValueMsg="请选择职位。" emptyValueForValidate="-1" cssClass="control-width-40 clearable input-control selectable-field" cssStyle="width: 152px; height: 26px"></s:select>
				</td>
			</tr>
			<tr>
				<td colspan="4" align="center">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td colspan="4" align="center">
					<input id="btnSubmit" type="submit" class="o-btn" value="提交"/>
				</td>
			</tr>
			<tr>
				<td colspan="4" align="center">
					&nbsp;
				</td>
			</tr>
		</table>
		</form>
		<div id="errorSummary"></div>
	</body>
</html>